Skip to content

Phase 8: replace voice clips with Samantha TTS, fix end click#9

Open
kiranj26 wants to merge 1 commit intorelease/v2-productfrom
feature/speaker-swap
Open

Phase 8: replace voice clips with Samantha TTS, fix end click#9
kiranj26 wants to merge 1 commit intorelease/v2-productfrom
feature/speaker-swap

Conversation

@kiranj26
Copy link
Copy Markdown
Owner

@kiranj26 kiranj26 commented May 4, 2026

Summary

  • Replaced both WAV clips with macOS Samantha voice (say -r 155) + afconvert to 16kHz 16-bit mono — previous flat TTS sounded monotone and low-pitched on the 20mm 8Ω speaker
  • Added 200ms silence padding to sit_up.wav to eliminate the click from i2s_set_clk restoring 44.1kHz before the DMA buffer drains
  • Added gen_wav_arrays.py to regenerate .c arrays from WAV files in one command

Phase 8 pass criteria — verified on hardware

  • Boot tone audible at 1m
  • "Sit up straight" clearly intelligible at 1m, quiet room
  • "Thank you, good work" clearly intelligible at 1m
  • No distortion, no rattle from 20mm cone
  • No click at end of "Sit up straight"
  • Volume acceptable — VOL_VOICE 0.90f unchanged

To regenerate clips in future

say -v "Samantha" -r 155 -o /tmp/sit_up.aiff "Sit up straight"
say -v "Samantha" -r 155 -o /tmp/thank_you.aiff "Thank you, good work"
afconvert -f WAVE -d LEI16@16000 /tmp/sit_up.aiff src/main/voice/sit_up.wav
afconvert -f WAVE -d LEI16@16000 /tmp/thank_you.aiff src/main/voice/thank_you_good_work.wav
python3 src/main/voice/gen_wav_arrays.py
pio run

🤖 Generated with Claude Code

Regenerated sit_up.wav and thank_you_good_work.wav using macOS `say`
(Samantha voice, -r 155 WPM) + afconvert to 16kHz 16-bit mono. Previous
clips were flat TTS that sounded monotone and low-pitched on the 20mm 8Ω
speaker. New recordings are clearer and more natural on the small cone.

Added 200ms silence padding to sit_up.wav to eliminate the click caused
by i2s_set_clk restoring 44.1kHz before the DMA buffer drains fully.

Added gen_wav_arrays.py to regenerate .c arrays from WAV files without
manual xxd — run from repo root after updating any WAV file.

Phase 8 pass criteria verified on hardware:
- Boot tone, cal tones, warning beeps — all clear at 1m
- "Sit up straight" intelligible at 1m, clean ending
- "Thank you, good work" intelligible at 1m
- No distortion, no rattle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant